Skip to content

Fix TypedArray.wrap definition - #939

Merged
dcodeIO merged 8 commits into
AssemblyScript:masterfrom
MaxGraey:fix-typedarray-wrap-def
Nov 16, 2019
Merged

dcodeIO merged 8 commits into
AssemblyScript:masterfrom
MaxGraey:fix-typedarray-wrap-def

Conversation

@MaxGraey

@MaxGraey MaxGraey commented Nov 7, 2019

Copy link
Copy Markdown
Member

Relate to #938

@dcodeIO

dcodeIO commented Nov 7, 2019

Copy link
Copy Markdown
Member

Considering that the implementation isn't generic, wouldn't it be straight-forward to model the declaration exactly like that by adding one .wrap to each subclass with a concrete return type? Would otherwise imagine that someone could try to use it as a generic function with unexpected results.

@MaxGraey

MaxGraey commented Nov 7, 2019 •

Copy link
Copy Markdown
Member Author

I simplified this. I guess this completely solved issue

@MaxGraey

MaxGraey commented Nov 7, 2019 •

Copy link
Copy Markdown
Member Author

Considering that the implementation isn't generic, wouldn't it be straight-forward to model the declaration exactly like that by adding one .wrap to each subclass with a concrete return type?

What about this?

static wrap<_T = TypedArray<number>>(this: Constructor<_T>, ...): _T;

@MaxGraey
MaxGraey requested a review from dcodeIO November 16, 2019 14:10
@dcodeIO
dcodeIO merged commit b2bb264 into AssemblyScript:master Nov 16, 2019
@dcodeIO

dcodeIO commented Nov 16, 2019

Copy link
Copy Markdown
Member

That's ideal, thanks! :)

@MaxGraey
MaxGraey deleted the fix-typedarray-wrap-def branch November 16, 2019 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants